using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace RewiredConsts.__Naptime
{
	[CreateAssetMenu(menuName = "Configs/DynamicIconChangerConfig", fileName = "DynamicIconChangerConfig")]
	public sealed class DynamicIconChangerConfig : ScriptableObject
	{
		[SerializeField]
		private List<IconChangerConfigData> iconChangerConfigData;

		private Dictionary<string, ChangeableIconChunk> _idToIconChunks;

		public ChangeableIconChunk GetIcons(string id)
		{
			if (_idToIconChunks == null)
			{
				_idToIconChunks = iconChangerConfigData.ToDictionary((IconChangerConfigData e) => e.id, delegate(IconChangerConfigData e)
				{
					ChangeableIconChunk result = default(ChangeableIconChunk);
					result.playStationIcon = e.psIcon;
					result.xboxIcon = e.xboxIcon;
					result.pcIcon = e.pcIcon;
					result.nintendoIcon = e.nintendoIcon;
					result.nintendoSingleJoyConIcon = e.nintendoSingleJoyConIcon;
					result.steamDeck = e.steamDeck;
					return result;
				});
			}
			return _idToIconChunks.GetValueOrDefault(id);
		}
	}
}
